package com.zt.teacher.service.impl;

import com.zt.common.pojo.exam.ExamQuestionBank;
import com.zt.teacher.dao.ExamQuestionBankDao;
import com.zt.teacher.service.ExamQuestionBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * description:
 * author:zt
 * date:2022-01-17
 */
@Service
@Transactional
public class ExamQuestionBankServiceImpl implements ExamQuestionBankService {

    @Autowired
    private ExamQuestionBankDao examQuestionBankDao;

    @Override
    public List<ExamQuestionBank> getQuestionByCourseId(int courseId) {
        return examQuestionBankDao.getQuestionByCourseId(courseId);
    }

    @Override
    public int insert(ExamQuestionBank examQuestionBank) {
        examQuestionBankDao.insert(examQuestionBank);
        return examQuestionBank.getId();
    }

    @Override
    public List<ExamQuestionBank> getQuestionByIds(List<Integer> questionIds) {
        return examQuestionBankDao.getQuestionByIds(questionIds);
    }
}
